<%@ page import="com.zjm.jstl.pojo.Person" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Map" %><%--
  Created by IntelliJ IDEA.
  User: ZJM
  Date: 2024/4/18
  Time: 22:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>Title</title>
</head>
<body>
<%
  Person person = new Person();
  person.setName("zjm");
  person.setPhones(new String[]{"1478918974", "3128764617439", "1456781946"});
  ArrayList<String> cities = new ArrayList<>();
  cities.add("北京");
  cities.add("上海");
  cities.add("广东");
  person.setCities(cities);
  Map<String, Object> map = new HashMap<>();
  map.put("key1", "value1");
  map.put("key2", "value2");
  map.put("key3", "value3");
  person.setMap(map);

  request.setAttribute("per", person);
%>
<%--EL表达式输出复杂的JavaBean对象--%>
<div>${per}</div>
<div>${per.name}</div>
<div>${per.phones[0]}</div>
<div>${per.cities.get(0)}</div>
<div>${per.cities[0]}</div>
<div>${per.map}</div>
<div>${per.map.get("key1")}</div>
<div>${per.map.key2}</div>
</body>
</html>
